<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="productCode" value="${param.orderCode}"></c:set>
<div class="easyui-layout" style="width:100%;height:100%;" fit="true">
	 	<div class="easyui-tabs"  data-options="tools:'#tab-tools',plain:true,region:'center',title:'',border:false" style="margin-top: 20px;" >
          
  <div  title="订单状态" >
  			
             <table class="detailTable"> 
                      <tr>
                        <th style="width: 100px;">订单编号</th>
                        <td class="juleft">
                      		<p id="d_orderCode"></p>
                        </td>
                        <th>订单状态</th>
                        <td class="juleft"  >
                        	<p id="d_status"></p>
                        </td>
                      </tr>
                      <tr>
                        <th style="width: 100px;">确认金额</th>
                        <td class="juleft" id="d_confirmMoney">
                        </td>
                        <th>订单日期</th>
                        <td class="juleft" id="d_createDate"></td>
                      </tr>
              </table>
              <table id="orderDetailTable" style="height: 350px;">  </table>
        	</div>
         
            <div  title="订单收货信息" >
            	 <table class="detailTable">   <tr>
                        <th style="width: 100px;">收货地址</th>
                        <td class="juleft">
                      		<p id="d_address"></p>
                        </td>
                      </tr>
                      <tr>
                        <th style="width: 100px;">收货联系人</th>
                        <td class="juleft"  >
                        	<p id="d_consignee"></p>
                        </td>
                      </tr>
                      <tr>
                        <th style="width: 100px;">收货人联系电话</th>
                        <td class="juleft" id="d_phone">
                       	
                        </td>
                      </tr>
              </table>
        	</div>
            <div  title="订单开票信息" >
             <table class="detailTable">  
               <tr>
                        <th style="width: 100px;">开票开户银行</th>
                        <td class="juleft" id="d_invbankname"> </td>
                      </tr>
                      <tr>
                        <th style="width: 100px;">开票电话</th>
                        <td class="juleft" > </td>
                      </tr>
                      <tr>
                        <th style="width: 100px;">开票开户账号</th>
                        <td class="juleft" id="d_invaccno"></td>
                      </tr>
                      <tr>
                        <th style="width: 100px;">开票税号</th>
                        <td class="juleft" id="d_invtaxno"></td>
                      </tr>
                      <tr>
                        <th style="width: 100px;">开票单位</th>
                        <td class="juleft" id="d_invaddress"></td>
                      </tr>
                      <tr>
                        <th style="width: 100px;">开票地址</th>
                        <td class="juleft" id="d_invcustomname"> </td>
                      </tr>
              </table>
        	</div>
       </div>
	 	  </div>
<script>
$(function(){

	$('#orderDetailTable').pDataGrid({
		 columns:[[
	          	  {field:'productCode',title:'编码',align:'center',sortable:true},
	              {field:'chsName',title:'品名',align:'center',sortable:true},
	              {field:'productSpec',title:'规格',align:'center',sortable:true},
	              {field:'producingName',title:'生产厂家',align:'center',sortable:true},
	              {field:'authorizeNumber',title:'批准文号',align:'center',sortable:true},
	              {field:'priceUseType',title:'价格类型',align:'center',sortable:true},
	              {field:'salePrice',title:'价格',align:'center',sortable:true},
	              {field:'batchNumber',title:'批号',align:'center',sortable:true},
	              {field:'validMonth',title:'效期(月)',align:'center',sortable:true},
	              {field:'confirmAmount',title:'数量',align:'center',sortable:true},
	              {field:'confirmMoney',title:'汇总(元)',align:'center',sortable:true},
	              {field:'action',title:'操作',align:'center',sortable:true}
		          ]],
		    url:'<c:url value="/trade/searchOrderDetail.do"/>',  
		    pagination:false,
		    queryParams:{"orderCode":'<c:out value="${productCode}" />'},
			completeCallback:function(data){
				if(data.code == "100"){
					layer.msg(data.result);
				}else{
					$("#d_orderCode").html(data.data.emSOrder.orderCode);
					$("#d_status").html(data.data.emSOrder.strStatus);
					$("#d_confirmMoney").html(data.data.emSOrder.confirmMoney);
					$("#d_createDate").html(formatter(data.data.emSOrder.createDate));

					
				 	$("#d_address").html(data.data.emSOrderAddress.address);
				 	$("#d_consignee").text(data.data.emSOrderAddress.consignee);
				 	$("#d_phone").text(data.data.emSOrderAddress.phone);

				 	$("#d_invbankname").text(data.data.emCBuyer.invbankname);
				 	$("#d_invaccno").text(data.data.emCBuyer.invaccno);
				 	$("#d_invtaxno").text(data.data.emCBuyer.invtaxno);
				 	$("#d_invaddress").text(data.data.emCBuyer.invaddress);
				 	$("#d_invcustomname").text(data.data.emCBuyer.invcustomname);
				}
			}
			 
	}); 
});
function formatter(date){  
    var unixTimestamp = new Date(date);  
    return unixTimestamp.toLocaleString();  
    }

</script>